package weaver.interfaces.jjy.duss.util;

import com.sap.mw.jco.JCO;
import java.util.HashMap;
import java.util.Map;



/**
 * @program: ecology-9-demo
 * @description: ${description}
 * @author: Dusongsong
 * @create: 2019-12-07
 */
public class InputPernrUtil {

        public  Map execute(Map<String,String> map) {
            SAPConnPool SAPConn = new SAPConnPool();
            JCO.Client myConnection = SAPConn.getConnection();
            JCO.Function bapi = SAPConn.excuteBapi("ZFM_HR_PERNR");

            JCO.ParameterList input = bapi.getImportParameterList();//输入参数和结构处理
            JCO.ParameterList inputtable = bapi.getTableParameterList();//输入表的处理
            //入参为字段
            input.setValue("SEL","JIEKNO");
            input.setValue(map.get("pernr"),"IV_PERNR");

            //执行函数
            myConnection.execute(bapi);
            JCO.ParameterList  out = bapi.getExportParameterList();//输出参数和结构处理
            JCO.ParameterList  Table00 = bapi.getTableParameterList();//输出表的处理

            //返回处理结果以及日志
            Map<String,String> resultMap = new HashMap<String,String>();
            resultMap = SAPComMehtod.SAPreturn(out,Table00);
            return resultMap;
        }

        public static void main(String[] args) {
           InputPernrUtil pernrUtil = new InputPernrUtil();
            Map map = new HashMap();
            map.put("pernr","16041226");
            System.out.println(pernrUtil.execute(map));
        }
    }


